<?php
error_reporting(E_ALL);

define('HOST',$_SERVER['HTTP_HOST']);

if(!defined('MEMCACHE_COMPRESSED')){
	define('MEMCACHE_COMPRESSED',2);
}

$strDir=dirname(__FILE__);

/*
 * define('RELEASE_VERSION',trim(file_get_contents('version/'.APP_NAME.'.RELEASE_VERSION')));
 * define('KERNEL_VERSION',trim(file_get_contents('version/KERNEL_VERSION')));
 * define('APP_PATH',realpath('../release/'.APP_NAME.'/'.RELEASE_VERSION));
 * define('COMMON_PATH',realpath('../release/system/'.KERNEL_VERSION.'/common'));
 * define('SYS_PATH',realpath('../release/system/'.KERNEL_VERSION.'/kernel'));
 */

define('COMMON_PATH',$strDir.'/system/common');
define('SYS_PATH',$strDir.'/system/kernel');
define('COMMON_CFG_PATH',$strDir.'/system/common/config');
define('SYS_CFG_PATH',$strDir.'/system/kernel/config');

switch(HOST){
	case 'file.test.anjuke.com':
	case 'upd.test.anjuke.com':
	case 'www.test.anjuke.com':
		define('APP_NAME','app-file');
		define('APP_PATH',$strDir.'/app-file');
		define('APP_CFG_PATH',$strDir.'/app-file/config');
		switch(HOST){
			case 'file.test.anjuke.com':
				define('CST_CFG_PATH',$strDir.'/config/file/file');
				$G_LOAD_PATH=array( 
						APP_PATH,
						COMMON_PATH,
						SYS_PATH 
				);
				$G_CONFIG_PATH=array( 
						SYS_CFG_PATH,
						COMMON_CFG_PATH,
						APP_CFG_PATH,
						CST_CFG_PATH 
				);
				break;
			case 'upd.test.anjuke.com':
				define('CST_CFG_PATH',$strDir.'/config/file/upd');
				$G_LOAD_PATH=array( 
						APP_PATH,
						COMMON_PATH,
						SYS_PATH 
				);
				$G_CONFIG_PATH=array( 
						SYS_CFG_PATH,
						COMMON_CFG_PATH,
						APP_CFG_PATH,
						CST_CFG_PATH 
				);
				break;
			case 'www.test.anjuke.com':
				define('CST_CFG_PATH',$strDir.'/config/file/www');
				$G_LOAD_PATH=array( 
						SYS_PATH 
				);
				$G_CONFIG_PATH=array( 
						SYS_CFG_PATH,
						CST_CFG_PATH 
				);
				break;
		}
		break;
	default:
		define('APP_NAME','');
		break;
}

include_once (SYS_PATH.'/bin.php');

main();
